#ifndef __CONDUCTOR_H
#define __CONDUCTOR_H
#include "matrix.h"
#include "thread.h"

/**
 * insert a thread callback definition
 * @param thread: the descriptor of thread to be insert
 * @return: void
 * @note: called when the system inster a thread
 */
void mx_conductor_add (mx_thread_pt pthread);
/**
 * remove a thread callback definition
 * @param thread: the descriptor of thread to be remove
 * @return: void
 * @note: called when the system remove a thread
 */
void mx_conductor_remove (mx_thread_pt pthread);
/**
 * change the status of the specified thread
 * @param thread: the descriptor of thread
 * @param status: the target status to be convert
 * @return: void
 * @note: call this function when the system change the status of thread
 */
void mx_conductor_chstat (mx_thread_pt pthread, mx_thread_status_t status);
/**
 * get the highest ready thread
 * @return: the descriptor of thread
 * @note: scheduling algorithm need to deal with the situation that there have multi-same
 *        priority thread
 */
mx_thread_pt mx_conductor_highest (void);
/**
 * check whether there are multiple threads with the same priority as the specified thread
 * in the system
 * @param pthread: the descriptor of thread
 * @return: void
 */
mx_bool_t mx_conductor_hascrew(mx_thread_pt pthread);
/**
 * get the active thread in system now
 * @param: void
 * @return: the descriptor of active thread
 */
mx_thread_pt mx_conductor_active (void);
/**
 * change the active thread
 * @param pthread: the descriptor of target thread
 * @return: void
 */
void mx_conductor_chactive (mx_thread_pt pthread);

#endif
